Skip to content

feat(config): more customization#682

Draft
avivkeller wants to merge 3 commits intomainfrom
more-config
Draft

feat(config): more customization#682
avivkeller wants to merge 3 commits intomainfrom
more-config

Conversation

@avivkeller
Copy link
Member

Depends-on #672

Resolves #671
Resolves #661
Resolves? #332


This PR, as a follow-up to #672, turns all the hardcoded Node.js variables outside of legacy generators into configuration options. Legacy generators have only changed when they share a configuration option with another generator. The output of these generators shouldn't have changed.

@avivkeller avivkeller requested a review from a team as a code owner March 15, 2026 20:36
Copilot AI review requested due to automatic review settings March 15, 2026 20:36
@avivkeller avivkeller marked this pull request as draft March 15, 2026 20:36
@vercel
Copy link

vercel bot commented Mar 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Mar 15, 2026 8:36pm

Request Review

@avivkeller avivkeller changed the title More config feat(config): more customization Mar 15, 2026
@codecov
Copy link

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 56.43939% with 115 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.02%. Comparing base (84f6dac) to head (8cb94af).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/generators/ast/generate.mjs 0.00% 21 Missing ⚠️
src/utils/file.mjs 61.90% 16 Missing ⚠️
src/generators/jsx-ast/generate.mjs 0.00% 11 Missing ⚠️
...enerators/sitemap/utils/createPageSitemapEntry.mjs 0.00% 11 Missing ⚠️
src/generators/web/utils/processing.mjs 0.00% 11 Missing ⚠️
...rc/generators/legacy-html/utils/buildDropdowns.mjs 0.00% 9 Missing ⚠️
src/generators/man-page/generate.mjs 0.00% 7 Missing ⚠️
src/generators/legacy-html/generate.mjs 0.00% 5 Missing ⚠️
src/generators/sitemap/generate.mjs 0.00% 5 Missing ⚠️
...rators/legacy-html/utils/replaceTemplateValues.mjs 0.00% 4 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #682      +/-   ##
==========================================
- Coverage   74.76%   74.02%   -0.75%     
==========================================
  Files         146      145       -1     
  Lines       13251    13257       +6     
  Branches      960      953       -7     
==========================================
- Hits         9907     9813      -94     
- Misses       3338     3439     +101     
+ Partials        6        5       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

api-links Generator

apilinks.json
Expected values to be strictly deep-equal:
+ actual - expected
... Skipped lines

  {
    'Agent.defaultMaxSockets': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L227',
    'Buffer.alloc': 'https://github.com/nodejs/node/blob/HEAD/lib/buffer.js#L432',
    'Buffer.allocUnsafe': 'https://github.com/nodejs/node/blob/HEAD/lib/buffer.js#L446',
    'Buffer.allocUnsafeSlow': 'https://github.com/nodejs/node/blob/HEAD/lib/buffer.js#L458',
...
    'agent.addRequest': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L292',
+   'agent.createConnection': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L231',
-   'agent.createConnection': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L326',
    'agent.createSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L363',
    'agent.destroy': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L595',
+   'agent.getName': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L261',
-   'agent.getName': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L484',
    'agent.keepSocketAlive': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L552',
    'agent.removeSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L491',
    'agent.reuseSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_agent.js#L588',
    'assert.assert': 'https://github.com/nodejs/node/blob/HEAD/lib/assert.js#L185',
    'asyncResource.asyncId': 'https://github.com/nodejs/node/blob/HEAD/lib/async_hooks.js#L242',
...
    'server.address': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2289',
+   'server.close': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L614',
+   'server.closeAllConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L624',
+   'server.closeIdleConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L636',
-   'server.close': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2422',
-   'server.closeAllConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L120',
-   'server.closeIdleConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L122',
    'server.getConnections': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2384',
    'server.listen': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2106',
    'server.ref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2527',
+   'server.setTimeout': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L652',
-   'server.setTimeout': 'https://github.com/nodejs/node/blob/HEAD/lib/https.js#L124',
    'server.unref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2536',
+   'server[SymbolAsyncDispose]': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L620',
+   'server[undefined]': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L659',
-   'server[SymbolAsyncDispose]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2462',
-   'server[undefined]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L2491',
    'serverresponse._finish': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L246',
    'serverresponse._implicitHeader': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L360',
    'serverresponse.assignSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L296',
    'serverresponse.detachSocket': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L307',
    'serverresponse.statusCode': 'https://github.com/nodejs/node/blob/HEAD/lib/_http_server.js#L269',
...
    'socket.addSourceSpecificMembership': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L926',
+   'socket.address': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L815',
-   'socket.address': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L714',
    'socket.bind': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L267',
    'socket.close': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L778',
+   'socket.connect': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L412',
-   'socket.connect': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1281',
    'socket.destroySoon': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L856',
    'socket.disconnect': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L490',
    'socket.dropMembership': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L911',
    'socket.dropSourceSpecificMembership': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L944',
    'socket.end': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L795',
...
    'socket.read': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L839',
+   'socket.ref': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1001',
-   'socket.ref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1621',
    'socket.remoteAddress': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L827',
    'socket.resetAndDestroy': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L801',
    'socket.resume': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L830',
    'socket.send': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L615',
    'socket.sendto': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L504',
...
    'socket.setTypeOfService': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L661',
+   'socket.unref': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L1011',
-   'socket.unref': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1635',
    'socket[SymbolAsyncDispose]': 'https://github.com/nodejs/node/blob/HEAD/lib/dgram.js#L802',
    'socket[kAfterAsyncWrite]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L990',
    'socket[kReinitializeHandle]': 'https://github.com/nodejs/node/blob/HEAD/lib/net.js#L1349',
    'string_decoder.StringDecoder': 'https://github.com/nodejs/node/blob/HEAD/lib/string_decoder.js#L60',
    'timers.clearImmediate': 'https://github.com/nodejs/node/blob/HEAD/lib/timers.js#L226',

legacy-html Generator

File Base Head Diff
addons.html 332.51 KB 332.49 KB -24.00 B (-0.01%)
assert.html 466.93 KB 466.91 KB -24.00 B (-0.01%)
buffer.html 1.07 MB 1.07 MB -24.00 B (-0.00%)
child_process.html 442.26 KB 442.24 KB -24.00 B (-0.01%)
cluster.html 198.22 KB 198.20 KB -24.00 B (-0.01%)
console.html 97.90 KB 97.88 KB -24.00 B (-0.02%)
crypto.html 1007.96 KB 1007.93 KB -24.00 B (-0.00%)
debugger.html 37.80 KB 37.78 KB -24.00 B (-0.06%)
dgram.html 155.64 KB 155.61 KB -24.00 B (-0.02%)
dns.html 215.95 KB 215.92 KB -24.00 B (-0.01%)
documentation.html 25.73 KB 25.71 KB -24.00 B (-0.09%)
domain.html 101.17 KB 101.14 KB -24.00 B (-0.02%)
events.html 545.20 KB 545.18 KB -24.00 B (-0.00%)
fs.html 929.20 KB 929.17 KB -24.00 B (-0.00%)
globals.html 123.14 KB 123.12 KB -24.00 B (-0.02%)
http.html 597.93 KB 597.90 KB -24.00 B (-0.00%)
https.html 155.65 KB 155.62 KB -24.00 B (-0.02%)
index.html 17.51 KB 17.48 KB -24.00 B (-0.13%)
modules.html 151.53 KB 151.51 KB -24.00 B (-0.02%)
net.html 216.24 KB 216.22 KB -24.00 B (-0.01%)
os.html 83.60 KB 83.57 KB -24.00 B (-0.03%)
path.html 95.76 KB 95.74 KB -24.00 B (-0.02%)
process.html 689.76 KB 689.74 KB -24.00 B (-0.00%)
punycode.html 34.40 KB 34.38 KB -24.00 B (-0.07%)
querystring.html 33.76 KB 33.73 KB -24.00 B (-0.07%)
readline.html 204.62 KB 204.59 KB -24.00 B (-0.01%)
repl.html 218.49 KB 218.47 KB -24.00 B (-0.01%)
stream.html 822.50 KB 822.48 KB -24.00 B (-0.00%)
string_decoder.html 40.21 KB 40.19 KB -24.00 B (-0.06%)
synopsis.html 25.47 KB 25.45 KB -24.00 B (-0.09%)
timers.html 89.38 KB 89.36 KB -24.00 B (-0.03%)
tls.html 263.42 KB 263.40 KB -24.00 B (-0.01%)
tty.html 43.63 KB 43.61 KB -24.00 B (-0.05%)
url.html 322.42 KB 322.40 KB -24.00 B (-0.01%)
util.html 712.91 KB 712.89 KB -24.00 B (-0.00%)
vm.html 423.52 KB 423.50 KB -24.00 B (-0.01%)
zlib.html 276.26 KB 276.23 KB -24.00 B (-0.01%)
errors.html 349.54 KB 349.52 KB -22.00 B (-0.01%)
v8.html 312.33 KB 312.30 KB -22.00 B (-0.01%)
cli.html 287.99 KB 287.97 KB -21.00 B (-0.01%)
deprecations.html 263.45 KB 263.43 KB -19.00 B (-0.01%)
tracing.html 89.42 KB 89.40 KB -19.00 B (-0.02%)
async_hooks.html 220.38 KB 220.37 KB -18.00 B (-0.01%)
esm.html 126.96 KB 126.94 KB -18.00 B (-0.01%)
http2.html 744.51 KB 744.49 KB -18.00 B (-0.00%)
inspector.html 113.82 KB 113.80 KB -18.00 B (-0.02%)
intl.html 42.78 KB 42.76 KB -18.00 B (-0.04%)
n-api.html 767.40 KB 767.39 KB -18.00 B (-0.00%)
perf_hooks.html 349.49 KB 349.47 KB -18.00 B (-0.01%)
worker_threads.html 386.29 KB 386.28 KB -16.00 B (-0.00%)
report.html 187.86 KB 187.84 KB -15.00 B (-0.01%)
embedding.html 49.68 KB 49.66 KB -14.00 B (-0.03%)
module.html 336.40 KB 336.39 KB -14.00 B (-0.00%)
packages.html 123.16 KB 123.15 KB -14.00 B (-0.01%)
wasi.html 45.27 KB 45.26 KB -14.00 B (-0.03%)
diagnostics_channel.html 240.51 KB 240.50 KB -11.00 B (-0.00%)
webcrypto.html 334.73 KB 334.72 KB -11.00 B (-0.00%)
async_context.html 200.56 KB 200.55 KB -10.00 B (-0.00%)
webstreams.html 270.28 KB 270.27 KB -10.00 B (-0.00%)
test.html 819.50 KB 819.50 KB -8.00 B (-0.00%)
single-executable-applications.html 89.77 KB 89.76 KB -7.00 B (-0.01%)
environment_variables.html 24.61 KB 24.60 KB -6.00 B (-0.02%)
permissions.html 37.72 KB 37.71 KB -6.00 B (-0.02%)
sqlite.html 198.19 KB 198.19 KB -4.00 B (-0.00%)
typescript.html 33.37 KB 33.37 KB -4.00 B (-0.01%)
quic.html 142.57 KB 142.57 KB -3.00 B (-0.00%)

orama-db Generator

File Base Head Diff
orama-db.json 8.05 MB 8.05 MB -1.63 KB (-0.02%)

web Generator

File Base Head Diff
wasi.html 68.42 KB 69.01 KB +604.00 B (+0.86%)
vm.html 370.20 KB 370.77 KB +588.00 B (+0.16%)
index.html 35.01 KB 35.57 KB +573.00 B (+1.60%)
quic.html 357.30 KB 357.85 KB +571.00 B (+0.16%)
perf_hooks.html 379.49 KB 380.04 KB +564.00 B (+0.15%)
report.html 174.81 KB 175.36 KB +564.00 B (+0.32%)
dgram.html 193.63 KB 194.17 KB +558.00 B (+0.28%)
intl.html 57.04 KB 57.58 KB +558.00 B (+0.96%)
globals.html 227.53 KB 228.07 KB +556.00 B (+0.24%)
tls.html 373.24 KB 373.77 KB +546.00 B (+0.14%)
addons.html 261.47 KB 262.00 KB +542.00 B (+0.20%)
async_context.html 162.55 KB 163.08 KB +542.00 B (+0.33%)
async_hooks.html 158.70 KB 159.23 KB +542.00 B (+0.33%)
buffer.html 906.00 KB 906.53 KB +542.00 B (+0.06%)
cluster.html 195.07 KB 195.60 KB +542.00 B (+0.27%)
console.html 145.92 KB 146.45 KB +542.00 B (+0.36%)
crypto.html 1.02 MB 1.03 MB +542.00 B (+0.05%)
debugger.html 53.14 KB 53.67 KB +542.00 B (+1.00%)
deprecations.html 495.84 KB 496.37 KB +542.00 B (+0.11%)
diagnostics_channel.html 241.90 KB 242.43 KB +542.00 B (+0.22%)
dns.html 295.64 KB 296.17 KB +542.00 B (+0.18%)
documentation.html 36.96 KB 37.49 KB +542.00 B (+1.43%)
domain.html 104.02 KB 104.55 KB +542.00 B (+0.51%)
embedding.html 58.34 KB 58.87 KB +542.00 B (+0.91%)
environment_variables.html 42.92 KB 43.45 KB +542.00 B (+1.23%)
errors.html 459.67 KB 460.20 KB +542.00 B (+0.12%)
esm.html 154.10 KB 154.63 KB +542.00 B (+0.34%)
events.html 454.67 KB 455.20 KB +542.00 B (+0.12%)
fs.html 1.40 MB 1.40 MB +542.00 B (+0.04%)
http.html 736.61 KB 737.14 KB +542.00 B (+0.07%)
http2.html 768.96 KB 769.49 KB +542.00 B (+0.07%)
https.html 149.16 KB 149.69 KB +542.00 B (+0.35%)
inspector.html 170.35 KB 170.88 KB +542.00 B (+0.31%)
module.html 326.01 KB 326.54 KB +542.00 B (+0.16%)
modules.html 177.47 KB 178.00 KB +542.00 B (+0.30%)
net.html 381.40 KB 381.93 KB +542.00 B (+0.14%)
os.html 141.77 KB 142.30 KB +542.00 B (+0.37%)
packages.html 153.62 KB 154.15 KB +542.00 B (+0.34%)
path.html 138.26 KB 138.79 KB +542.00 B (+0.38%)
permissions.html 54.05 KB 54.58 KB +542.00 B (+0.98%)
process.html 674.27 KB 674.79 KB +542.00 B (+0.08%)
punycode.html 62.07 KB 62.60 KB +542.00 B (+0.85%)
readline.html 251.39 KB 251.92 KB +542.00 B (+0.21%)
repl.html 182.38 KB 182.91 KB +542.00 B (+0.29%)
single-executable-applications.html 105.92 KB 106.45 KB +542.00 B (+0.50%)
sqlite.html 267.84 KB 268.37 KB +542.00 B (+0.20%)
stream.html 858.06 KB 858.59 KB +542.00 B (+0.06%)
string_decoder.html 54.36 KB 54.89 KB +542.00 B (+0.97%)
synopsis.html 41.58 KB 42.11 KB +542.00 B (+1.27%)
test.html 739.27 KB 739.80 KB +542.00 B (+0.07%)
timers.html 132.60 KB 133.13 KB +542.00 B (+0.40%)
tracing.html 83.10 KB 83.63 KB +542.00 B (+0.64%)
tty.html 94.17 KB 94.70 KB +542.00 B (+0.56%)
typescript.html 52.38 KB 52.91 KB +542.00 B (+1.01%)
url.html 347.61 KB 348.14 KB +542.00 B (+0.15%)
v8.html 320.61 KB 321.14 KB +542.00 B (+0.17%)
webcrypto.html 505.27 KB 505.80 KB +542.00 B (+0.10%)
webstreams.html 355.98 KB 356.50 KB +542.00 B (+0.15%)
worker_threads.html 364.30 KB 364.83 KB +542.00 B (+0.15%)
zlib.html 289.88 KB 290.41 KB +542.00 B (+0.18%)
querystring.html 62.89 KB 63.41 KB +540.00 B (+0.84%)
child_process.html 382.03 KB 382.56 KB +538.00 B (+0.14%)
cli.html 489.55 KB 490.07 KB +534.00 B (+0.11%)
util.html 692.01 KB 692.53 KB +532.00 B (+0.08%)
assert.html 329.82 KB 330.33 KB +520.00 B (+0.15%)
n-api.html 806.20 KB 806.70 KB +506.00 B (+0.06%)
addons.js 292.76 KB 292.87 KB +104.00 B (+0.03%)
assert.js 453.76 KB 453.86 KB +104.00 B (+0.02%)
async_context.js 185.86 KB 185.96 KB +104.00 B (+0.05%)
async_hooks.js 195.17 KB 195.27 KB +104.00 B (+0.05%)
buffer.js 1.08 MB 1.08 MB +104.00 B (+0.01%)
child_process.js 465.17 KB 465.27 KB +104.00 B (+0.02%)
cli.js 299.75 KB 299.85 KB +104.00 B (+0.03%)
cluster.js 194.40 KB 194.50 KB +104.00 B (+0.05%)
console.js 105.86 KB 105.96 KB +104.00 B (+0.10%)
crypto.js 1.13 MB 1.13 MB +104.00 B (+0.01%)
debugger.js 29.63 KB 29.73 KB +104.00 B (+0.34%)
deprecations.js 283.27 KB 283.37 KB +104.00 B (+0.04%)
dgram.js 169.90 KB 170.00 KB +104.00 B (+0.06%)
diagnostics_channel.js 233.86 KB 233.96 KB +104.00 B (+0.04%)
dns.js 263.18 KB 263.28 KB +104.00 B (+0.04%)
documentation.js 8.96 KB 9.06 KB +104.00 B (+1.13%)
domain.js 89.57 KB 89.67 KB +104.00 B (+0.11%)
embedding.js 36.65 KB 36.76 KB +104.00 B (+0.28%)
environment_variables.js 14.42 KB 14.52 KB +104.00 B (+0.70%)
errors.js 350.80 KB 350.91 KB +104.00 B (+0.03%)
esm.js 134.90 KB 135.01 KB +104.00 B (+0.08%)
events.js 543.96 KB 544.06 KB +104.00 B (+0.02%)
fs.js 1.17 MB 1.17 MB +104.00 B (+0.01%)
globals.js 126.19 KB 126.29 KB +104.00 B (+0.08%)
http.js 671.93 KB 672.04 KB +104.00 B (+0.02%)
http2.js 800.97 KB 801.07 KB +104.00 B (+0.01%)
https.js 159.23 KB 159.33 KB +104.00 B (+0.06%)
index.js 9.50 KB 9.60 KB +104.00 B (+1.07%)
inspector.js 118.60 KB 118.70 KB +104.00 B (+0.09%)
intl.js 35.88 KB 35.98 KB +104.00 B (+0.28%)
module.js 334.68 KB 334.78 KB +104.00 B (+0.03%)
modules.js 148.15 KB 148.25 KB +104.00 B (+0.07%)
n-api.js 710.24 KB 710.34 KB +104.00 B (+0.01%)
net.js 276.11 KB 276.21 KB +104.00 B (+0.04%)
os.js 104.58 KB 104.68 KB +104.00 B (+0.10%)
packages.js 122.18 KB 122.28 KB +104.00 B (+0.08%)
path.js 96.01 KB 96.12 KB +104.00 B (+0.11%)
perf_hooks.js 359.48 KB 359.58 KB +104.00 B (+0.03%)
permissions.js 28.26 KB 28.36 KB +104.00 B (+0.36%)
process.js 703.91 KB 704.01 KB +104.00 B (+0.01%)
punycode.js 27.34 KB 27.44 KB +104.00 B (+0.37%)
querystring.js 30.26 KB 30.36 KB +104.00 B (+0.34%)
quic.js 152.98 KB 153.08 KB +104.00 B (+0.07%)
readline.js 221.64 KB 221.74 KB +104.00 B (+0.05%)
repl.js 209.05 KB 209.15 KB +104.00 B (+0.05%)
report.js 187.97 KB 188.07 KB +104.00 B (+0.05%)
single-executable-applications.js 83.00 KB 83.10 KB +104.00 B (+0.12%)
sqlite.js 228.79 KB 228.89 KB +104.00 B (+0.04%)
stream.js 851.40 KB 851.50 KB +104.00 B (+0.01%)
string_decoder.js 30.77 KB 30.88 KB +104.00 B (+0.33%)
synopsis.js 15.39 KB 15.49 KB +104.00 B (+0.66%)
test.js 851.39 KB 851.49 KB +104.00 B (+0.01%)
timers.js 97.38 KB 97.49 KB +104.00 B (+0.10%)
tls.js 313.08 KB 313.18 KB +104.00 B (+0.03%)
tracing.js 76.59 KB 76.69 KB +104.00 B (+0.13%)
tty.js 46.94 KB 47.04 KB +104.00 B (+0.22%)
typescript.js 24.04 KB 24.14 KB +104.00 B (+0.42%)
url.js 335.30 KB 335.41 KB +104.00 B (+0.03%)
util.js 741.04 KB 741.14 KB +104.00 B (+0.01%)
v8.js 330.23 KB 330.33 KB +104.00 B (+0.03%)
vm.js 436.83 KB 436.93 KB +104.00 B (+0.02%)
wasi.js 41.40 KB 41.50 KB +104.00 B (+0.25%)
webcrypto.js 380.50 KB 380.60 KB +104.00 B (+0.03%)
webstreams.js 283.17 KB 283.28 KB +104.00 B (+0.04%)
worker_threads.js 394.03 KB 394.13 KB +104.00 B (+0.03%)
zlib.js 312.11 KB 312.21 KB +104.00 B (+0.03%)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the “more config” effort by removing hardcoded Node.js–specific URLs/paths and replacing them with configurable URL templates across multiple generators, while also introducing a shared filesystem utility layer and path-aware docs output.

Changes:

  • Introduces src/utils/file.mjs helpers (writeFile, withExt, href) and migrates generators to use recursive output writing.
  • Reworks doc identity/routing around MetadataEntry.path (and basename) to support nested docs and configurable URL templates.
  • Adds configurable URL templates (e.g., pageURL, indexURL, editURL, sourceURL) to generators like sitemap, llms-txt, legacy-html, jsx-ast, and api-links.

Reviewed changes

Copilot reviewed 40 out of 47 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/utils/generators.mjs Removes URL helpers now replaced by configurable templates.
src/utils/file.mjs Adds shared file/URL-ish helpers (writeFile, withExt, href).
src/utils/configuration/templates.mjs Simplifies GITHUB_EDIT_URL base for composition by generators.
src/threading/tests/parallel.test.mjs Updates tests for the newer stream(items, extra) usage and input shape.
src/generators/web/utils/processing.mjs Updates web HTML generation to support nested paths via {{root}}.
src/generators/web/template.html Uses {{root}} for stylesheet/script paths to support nested pages.
src/generators/web/generate.mjs Writes HTML using path and recursive writeFile.
src/generators/sitemap/utils/createPageSitemapEntry.mjs Builds sitemap URLs via configurable templates.
src/generators/sitemap/types.d.ts Adds indexURL/pageURL to generator configuration type.
src/generators/sitemap/index.mjs Defines default sitemap URL templates.
src/generators/sitemap/generate.mjs Uses templates for index/page sitemap locations and recursive writeFile.
src/generators/sitemap/README.md Documents new sitemap configuration options.
src/generators/orama-db/generate.mjs Switches href construction to be path-based; uses recursive writeFile.
src/generators/metadata/utils/parse.mjs Emits api, path, basename; makes typemap links relative.
src/generators/metadata/utils/tests/parse.test.mjs Updates metadata parse tests for the new path input.
src/generators/metadata/types.d.ts Adds path/basename to MetadataEntry.
src/generators/man-page/generate.mjs Updates output writing and changes how CLI sections are selected.
src/generators/llms-txt/utils/buildApiDocLink.mjs Builds links via configurable pageURL template.
src/generators/llms-txt/utils/tests/buildApiDocLink.test.mjs Updates llms-txt link tests for template-based config.
src/generators/llms-txt/types.d.ts Adds pageURL to llms-txt generator config type.
src/generators/llms-txt/index.mjs Provides default pageURL template.
src/generators/llms-txt/generate.mjs Uses recursive writeFile and passes full config to link builder.
src/generators/llms-txt/README.md Documents new llms-txt configuration options.
src/generators/legacy-html/utils/safeCopy.mjs Removes safeCopy utility.
src/generators/legacy-html/utils/replaceTemplateValues.mjs Switches to template-driven edit/version links using path.
src/generators/legacy-html/utils/buildDropdowns.mjs Uses pageURL template for “other versions” links.
src/generators/legacy-html/utils/tests/safeCopy.test.mjs Removes tests for deleted safeCopy.
src/generators/legacy-html/types.d.ts Adds pageURL/editURL config options.
src/generators/legacy-html/index.mjs Defines default pageURL/editURL templates.
src/generators/legacy-html/generate.mjs Replaces safeCopy with cp and uses recursive writeFile.
src/generators/legacy-html/README.md Documents new legacy-html configuration options.
src/generators/legacy-html-all/generate.mjs Adds path to template values to align with legacy-html changes.
src/generators/jsx-ast/utils/buildBarProps.mjs Uses template-driven edit/version URLs and basename-based filenames.
src/generators/jsx-ast/utils/tests/buildBarProps.test.mjs Updates tests for new URL-building and basename/path fields.
src/generators/jsx-ast/types.d.ts Adds pageURL/editURL config options.
src/generators/jsx-ast/index.mjs Provides default pageURL/editURL templates.
src/generators/jsx-ast/generate.mjs Builds relative sidebar links using path + href().
src/generators/jsx-ast/README.md Documents new jsx-ast configuration options.
src/generators/json-simple/generate.mjs Uses recursive writeFile.
src/generators/ast/generate.mjs Switches to path-based identity and adds glob-parent handling.
src/generators/api-links/types.d.ts Adds configurable sourceURL.
src/generators/api-links/index.mjs Provides default sourceURL template.
src/generators/api-links/generate.mjs Uses sourceURL template and recursive writeFile.
src/generators/api-links/README.md Documents new api-links configuration option.
src/generators/addon-verify/generate.mjs Uses recursive writeFile.
package.json Bumps version and adds glob-parent, removes vfile.
package-lock.json Lockfile updates for dependency changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +55 to +62
const files = config.input.flatMap(input => {
const parent = globParent(input);

return globSync(input, { ignore: config.ignore }).map(child => [
child,
parent,
]);
});
Comment on lines +40 to 42
for (const { html, path } of results) {
await writeFile(join(config.output, `${path}.html`), html, 'utf-8');
}
const href = populate(config.pageURL, {
...config,
path,
version: parsedVersion,
Comment on lines +47 to +49
// Slug the API (We use a non-class slugger, since we are fairly certain that `path` is unique)
const api = slug(path.slice(1).replace(sep, '-'));

Comment on lines 105 to 112
if (config.output) {
for (const path of config.additionalPathsToCopy) {
// Define the output folder for API docs assets
const assetsFolder = join(config.output, basename(path));

// Creates the assets folder if it does not exist
await mkdir(assetsFolder, { recursive: true });

// Copy all files from assets folder to output, skipping unchanged files
await safeCopy(path, assetsFolder);
// Copy all files from assets folder to output
await cp(path, assetsFolder, { recursive: true });
}
Comment on lines 36 to 48
// Find the appropriate headers
const optionsStart = components.findIndex(
const optionsStart = input.findIndex(
({ heading }) => heading.data.slug === config.cliOptionsHeaderSlug
);

const environmentStart = components.findIndex(
const environmentStart = input.findIndex(
({ heading }) => heading.data.slug === config.envVarsHeaderSlug
);

// The first header that is <3 in depth after environmentStart
const environmentEnd = components.findIndex(
const environmentEnd = input.findIndex(
({ heading }, index) => heading.depth < 3 && index > environmentStart
);

const templateValues = {
api: 'all',
path: 'all',
Comment on lines +19 to +22
defaultConfiguration: {
indexURL: '{baseURL}/latest/api/',
pageURL: '{indexURL}{path}.html',
},
Comment on lines 9 to 12

const file = { stem: 'fs', basename: 'fs.md' };
const path = 'fs';
const typeMap = {};

Comment on lines +117 to +119
// The number of occurances is 1 less than the length of the split
// We also remove 1 `/`, as the path begins with a `/`
const root = '../'.repeat(path.split(sep).length - 2) || './';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

More Configuration Options discussion: doc-kit jsx-ast generator manual paths and customization

2 participants